package com.ruoyi.yqhs.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yqhs.mapper.YqhsJyzMapper;
import com.ruoyi.yqhs.domain.YqhsJyz;
import com.ruoyi.yqhs.service.IYqhsJyzService;

/**
 * 加油站信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-31
 */
@Service
public class YqhsJyzServiceImpl implements IYqhsJyzService 
{
    @Autowired
    private YqhsJyzMapper yqhsJyzMapper;

    /**
     * 查询加油站信息
     * 
     * @param id 加油站信息主键
     * @return 加油站信息
     */
    @Override
    public YqhsJyz selectYqhsJyzById(Long id)
    {
        return yqhsJyzMapper.selectYqhsJyzById(id);
    }

    /**
     * 查询加油站信息列表
     * 
     * @param yqhsJyz 加油站信息
     * @return 加油站信息
     */
    @Override
    public List<YqhsJyz> selectYqhsJyzList(YqhsJyz yqhsJyz)
    {
        return yqhsJyzMapper.selectYqhsJyzList(yqhsJyz);
    }

    /**
     * 新增加油站信息
     * 
     * @param yqhsJyz 加油站信息
     * @return 结果
     */
    @Override
    public int insertYqhsJyz(YqhsJyz yqhsJyz)
    {
        yqhsJyz.setId(IdUtils.getId());
        yqhsJyz.setCreateTime(DateUtils.getNowDate());
        yqhsJyz.setCreateBy(SecurityUtils.getLoginUser().getUsername());
        return yqhsJyzMapper.insertYqhsJyz(yqhsJyz);
    }

    /**
     * 修改加油站信息
     * 
     * @param yqhsJyz 加油站信息
     * @return 结果
     */
    @Override
    public int updateYqhsJyz(YqhsJyz yqhsJyz)
    {
        yqhsJyz.setUpdateTime(DateUtils.getNowDate());
        yqhsJyz.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
        return yqhsJyzMapper.updateYqhsJyz(yqhsJyz);
    }

    /**
     * 批量删除加油站信息
     * 
     * @param ids 需要删除的加油站信息主键
     * @return 结果
     */
    @Override
    public int deleteYqhsJyzByIds(Long[] ids)
    {
        return yqhsJyzMapper.deleteYqhsJyzByIds(ids);
    }

    /**
     * 删除加油站信息信息
     * 
     * @param id 加油站信息主键
     * @return 结果
     */
    @Override
    public int deleteYqhsJyzById(Long id)
    {
        return yqhsJyzMapper.deleteYqhsJyzById(id);
    }
}
